package com.fzy.autogenerate.bean;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.Version;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.io.Serializable;
import java.time.LocalDateTime;
import lombok.Getter;
import lombok.Setter;

/**
 * <p>
 * 用户表
 * </p>
 *
 * @author ${myconfig.author
 * @since 2024-09-28
 */
@Getter
@Setter
@TableName("user")
public class User extends Model<User> {

    private static final long serialVersionUID = 1L;

    /**
     * ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 姓名
     */
    @TableField("name")
    private String name;

    /**
     * 年龄
     */
    @TableField("age")
    private Byte age;

    /**
     * 性别，l:男，2：女
     */
    @TableField("gender")
    private Byte gender;

    /**
     * 手机号
     */
    @TableField("phone")
    private String phone;

    /**
     * 标记数据有效性
     */
    @TableField(value = "status", fill = FieldFill.INSERT)
    @TableLogic
    private Byte status;

    @TableField("contacts")
    private String contacts;

    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    @TableField("version")
    @Version
    private Long version;

    @Override
    public Serializable pkVal() {
        return this.id;
    }
}
